<?php

	include("common.php");
	
	$result = mysql_query("SELECT * FROM `197_calendar` WHERE `date` = '" . $_GET['date'] . "'");
	$calendar = array();
	while($row = mysql_fetch_assoc($result)){
		array_push($calendar, $row);
	}
	
?>
<?php include("header.php"); ?>
<?php if(!AJAX){ ?><h1><?php echo $_GET['date']; ?> 行事曆</h1><?php } ?>
<?php if(empty($calendar)){ ?>
	<p>今日尚未有行事曆事項。</p>
<?php } else { ?>
	<ul>
		<?php foreach($calendar as $row){ ?>
			<li><?php echo htmlspecialchars(AJAX ? $row['description'] : $row['content']); ?></li>
		<?php } ?>
	</ul>
	<?php if(AJAX){ ?><p><a href="calendarInfo.php?date=<?php echo $_GET['date']; ?>">詳細資訊</a></p><?php } ?>
<?php } ?>
<?php include("sidebar.php"); ?>
<?php include("footer.php"); ?>